package com.geekgo.flowcontroller.core.converter;

import org.apache.commons.beanutils.ConvertUtils;

/**
 * @author geekgo
 * @version 2016/8/4 17:52
 */
public class NumberRateConverter extends IndexArgRateConverter {

    public NumberRateConverter(int argIndex) {
        super(argIndex);
    }

    @Override
    public int acquire(Object[] args) {
        Object number = args[getArgIndex()];
        return (int)ConvertUtils.convert(number,int.class);
    }
}
